public class Test {
    public static void main(String[] args) {
        BinaryTree binaryTree = new BinaryTree();
        BinaryTree.TreeNode root = binaryTree.createTree();
        //前序遍历
        System.out.println("=======前序=======");
        binaryTree.preOrder(root);
        System.out.println();

        //后续遍历
        System.out.println("=======后序=======");
        binaryTree.postOrder(root);
        System.out.println();

        //中序遍历
        System.out.println("=======中序=======");
        binaryTree.inOrder(root);
        System.out.println();

        //层序遍历
        System.out.println("=======层序=======");
        binaryTree.levelOrder(root);
        System.out.println();

        System.out.println("树的节点个数："+binaryTree.size(root));

        System.out.println("叶子节点个数："+binaryTree.getLeafNodeCount1(root));

        binaryTree.getLeafNodeCount2(root);
        System.out.println("叶子节点个数："+BinaryTree.leafSize);

        System.out.println("叶子节点个数："+binaryTree.getLeafNodeCount3(root));

        System.out.println("第1层的节点个数："+binaryTree.getKLevelNodeCount1(root,1));
        System.out.println("第2层的节点个数："+binaryTree.getKLevelNodeCount1(root,2));
        System.out.println("第3层的节点个数："+binaryTree.getKLevelNodeCount1(root,3));
        System.out.println("第4层的节点个数："+binaryTree.getKLevelNodeCount1(root,4));

        System.out.println("二叉树的高度："+binaryTree.getHeight(root));

        System.out.println(binaryTree.find(root,'A'));
        System.out.println(binaryTree.find(root,'l'));

        System.out.println(binaryTree.findValue(root, 'A').value);


        System.out.println(binaryTree.isCompleteTree(root));

        BinaryTree.TreeNode root2 = binaryTree.createTree2();

        System.out.println(binaryTree.isCompleteTree(root2));


    }
}
